﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;

namespace HMS.Logging
{
    public class Util
    {   
        public static void WritErrorLog(string className, string functionName, string msg, string stateVars = "", Exception ex = null)
        {
            ILog logger = log4net.LogManager.GetLogger(typeof(Util));
            logger.Error(
                String.Format("{0} : {1}METHOD={2}&MSG={3}&{4}{5},Error Trace:{6}", className, "end", functionName, msg, stateVars, "end2", ex.ToString()) );
        }

        public static void WritInfoLog(string className, string functionName, string msg, string stateVars = "")
        {
            ILog logger = log4net.LogManager.GetLogger(typeof(Util));
            logger.Info(
                String.Format("{0} : {1}METHOD={2}&MSG={3}&{4}{5}", className, "end", functionName, msg, stateVars, "end2"));
        }
    }
}
